import { createApp } from 'vue';
import App from './App.vue';
import router from './router';
import {store} from './store';
import Antd from 'ant-design-vue';
import 'ant-design-vue/dist/antd.css';
import * as Icons from '@ant-design/icons-vue';
import '@wangeditor/editor/dist/css/style.css';
import hljs from 'highlight.js' //导入代码高亮文件
import 'highlight.js/styles/github.css'  //导入代码高亮样式

const app = createApp(App);
// 全局使用图标
const icons: any = Icons;
for (const i in icons) {
  app.component(i, icons[i]);
}
//自定义一个代码高亮指令
app.directive('highlight',function (el) {
  const highlight = el.querySelectorAll('pre code');
  highlight.forEach((block: any)=>{
    hljs.highlightBlock(block)
  })
})
app.config.warnHandler = () => null;

app.use(Antd).use(store).use(router).mount('#app');